$OpenBSD: patch-configure,v 1.3 2013/07/04 12:44:30 benoit Exp $
--- configure.orig	Wed Apr 17 17:00:32 2013
+++ configure	Thu Jul  4 11:49:38 2013
@@ -589,7 +589,7 @@ if test "$_libpng" = auto ; then
 #include <png.h>
 int main(void) { return printf("%s\n", PNG_HEADER_VERSION_STRING); }
 EOF
-	cc_check $LDFLAGS $CXXFLAGS $LIBPNG_CFLAGS $LIBPNG_LIBS -lpng && _libpng=yes
+	cc_check $LDFLAGS $CXXFLAGS $LIBPNG_CFLAGS $LIBPNG_LIBS `pkg-config --libs libpng` && _libpng=yes
 fi
 if test "$_libpng" = yes ; then
 	echo "$_libpng"
